core: Fix 32/8 bit confusion in pack index listing
authorColin Walters <walters@verbum.org>
Tue, 1 May 2012 20:26:10 +0000 (16:26 -0400)
committerColin Walters <walters@verbum.org>
Tue, 1 May 2012 21:44:14 +0000 (17:44 -0400)
src/libostree/ostree-core.c
src/libostree/ostree-repo.c

index d649d384b47deffd8e7fc4622e2ea5fdae73f125..37a07371d40b3b297a33388599ee9b6f9fe76b1e 100644 (file)
@@ -767,6 +767,8 @@ GVariant *
 ostree_object_name_serialize (const char *checksum,
                               OstreeObjectType objtype)
 {
+  g_assert (objtype >= OSTREE_OBJECT_TYPE_FILE
+            && objtype <= OSTREE_OBJECT_TYPE_COMMIT);
   return g_variant_new ("(su)", checksum, (guint32)objtype);
 }
 
index 3aad78588147297ad1c9800bcc6f32c22d9b53ca..3fcf0840ccdc77a66886f5ab72df105eb2da31b8 100644 (file)
@@ -3327,7 +3327,7 @@ list_objects_in_index (OstreeRepo                     *self,
 {
   gboolean ret = FALSE;
   OstreeRepoPrivate *priv = GET_PRIVATE (self);
-  guint32 objtype_u8;
+  guint8 objtype_u8;
   guint64 offset;
   ot_lobj GFile *index_path = NULL;
   ot_lvariant GVariant *index_variant = NULL;